!
function(e) {
	if ("object" == typeof exports && "undefined" != typeof module) module.exports = e();
	else if ("function" == typeof define && define.amd) define([], e);
	else {
		var f;
		"undefined" != typeof window ? f = window : "undefined" != typeof global ? f = global : "undefined" != typeof self && (f = self), f.Select3 = e()
	}
}(function() {
	var define, module, exports;
	return (function e(t, n, r) {
		function s(o, u) {
			if (!n[o]) {
				if (!t[o]) {
					var a = typeof require == "function" && require;
					if (!u && a) return a(o, !0);
					if (i) return i(o, !0);
					var f = new Error("Cannot find module '" + o + "'");
					throw f.code = "MODULE_NOT_FOUND", f
				}
				var l = n[o] = {
					exports: {}
				};
				t[o][0].call(l.exports, function(e) {
					var n = t[o][1][e];
					return s(n ? n : e)
				}, l, l.exports, e, t, n, r)
			}
			return n[o].exports
		}
		var i = typeof require == "function" && require;
		for (var o = 0; o < r.length; o++) s(r[o]);
		return s
	})({
		1: [function(_dereq_, module, exports) {
			_dereq_(4);
			_dereq_(5);
			_dereq_(6);
			_dereq_(8);
			_dereq_(9);
			_dereq_(10);
			_dereq_(11);
			_dereq_(12);
			_dereq_(13);
			_dereq_(14);
			_dereq_(15);
			_dereq_(16);
			_dereq_(17);
			_dereq_(18);
			module.exports = _dereq_(7)
		}, {}],
		2: [function(_dereq_, module, exports) {
			'use strict';
			var now = Date.now;

			function debounce(func, wait) {
				var args, result, stamp, timeoutId, trailingCall, lastCalled = 0;
				wait = wait < 0 ? 0 : (+wait || 0);

				function delayed() {
					var remaining = wait - (now() - stamp);
					if (remaining <= 0 || remaining > wait) {
						var isCalled = trailingCall;
						timeoutId = trailingCall = undefined;
						if (isCalled) {
							lastCalled = now();
							result = func.apply(null, args);
							if (!timeoutId) {
								args = null
							}
						}
					} else {
						timeoutId = setTimeout(delayed, remaining)
					}
				}
				function debounced() {
					args = arguments;
					stamp = now();
					trailingCall = true;
					if (!timeoutId) {
						timeoutId = setTimeout(delayed, wait)
					}
					return result
				}
				return debounced
			}
			module.exports = debounce
		}, {}],
		3: [function(_dereq_, module, exports) {
			'use strict';
			var htmlEscapes = {
				'&': '&amp;',
				'<': '&lt;',
				'>': '&gt;',
				'"': '&quot;',
				"'": '&#39;'
			};

			function escapeHtmlChar(match) {
				return htmlEscapes[match]
			}
			var reUnescapedHtml = new RegExp('[' + Object.keys(htmlEscapes).join('') + ']', 'g');

			function escape(string) {
				return string ? String(string).replace(reUnescapedHtml, escapeHtmlChar) : ''
			}
			module.exports = escape
		}, {}],
		4: [function(_dereq_, module, exports) {
			'use strict';
			var $ = window.jQuery || window.Zepto;
			var debounce = _dereq_(2);
			var Select3 = _dereq_(7);
			_dereq_(12);
			Select3.OptionListeners.unshift(function(select3, options) {
				var ajax = options.ajax;
				if (ajax && ajax.url) {
					var formatError = ajax.formatError || Select3.Locale.ajaxError;
					var minimumInputLength = ajax.minimumInputLength || 0;
					var params = ajax.params;
					var processItem = ajax.processItem ||
					function(item) {
						return item
					};
					var quietMillis = ajax.quietMillis || 0;
					var resultsCb = ajax.results ||
					function(data) {
						return {
							results: data,
							more: false
						}
					};
					var transport = ajax.transport || $.ajax;
					if (quietMillis) {
						transport = debounce(transport, quietMillis)
					}
					options.query = function(queryOptions) {
						var offset = queryOptions.offset;
						var term = queryOptions.term;
						if (term.length < minimumInputLength) {
							queryOptions.error(Select3.Locale.needMoreCharacters(minimumInputLength - term.length))
						} else {
							select3.dropdown.showLoading();
							var url = (ajax.url instanceof Function ? ajax.url() : ajax.url);
							if (params) {
								url += (url.indexOf('?') > -1 ? '&' : '?') + $.param(params(term, offset))
							}
							var success = ajax.success;
							var error = ajax.error;
							transport($.extend({}, ajax, {
								url: url,
								success: function(data, textStatus, jqXHR) {
									if (success) {
										success(data, textStatus, jqXHR)
									}
									var results = resultsCb(data, offset);
									results.results = results.results.map(processItem);
									queryOptions.callback(results)
								},
								error: function(jqXHR, textStatus, errorThrown) {
									if (error) {
										error(jqXHR, textStatus, errorThrown)
									}
									queryOptions.error(formatError(term, jqXHR, textStatus, errorThrown), {
										escape: false
									})
								}
							}))
						}
					}
				}
			})
		}, {}],
		5: [function(_dereq_, module, exports) {
			'use strict';
			var Select3 = _dereq_(7);
			var latestQueryNum = 0;
			Select3.OptionListeners.push(function(select3, options) {
				var query = options.query;
				if (query) {
					options.query = function(queryOptions) {
						latestQueryNum++;
						var queryNum = latestQueryNum;
						var callback = queryOptions.callback;
						var error = queryOptions.error;
						queryOptions.callback = function() {
							if (queryNum === latestQueryNum) {
								callback.apply(null, arguments)
							}
						};
						queryOptions.error = function() {
							if (queryNum === latestQueryNum) {
								error.apply(null, arguments)
							}
						};
						query(queryOptions)
					}
				}
			})
		}, {}],
		6: [function(_dereq_, module, exports) {
			'use strict';
			var $ = window.jQuery || window.Zepto;
			var Select3Dropdown = _dereq_(9);
			var BACKDROP_Z_INDEX = 1;
			var FOREGROUND_Z_INDEX = 2;
			$.extend(Select3Dropdown.prototype, {
				addToDom: function() {
					var $select3El = this.select3.$el;
					$select3El.css({
						zIndex: FOREGROUND_Z_INDEX,
						position: 'relative'
					});
					this.$el.appendTo($select3El[0].ownerDocument.body).css('zIndex', FOREGROUND_Z_INDEX)
				},
				removeCloseHandler: function() {
					if (this._$backdrop && !this.parentMenu) {
						this._$backdrop.remove();
						this._$backdrop = null
					}
				},
				setupCloseHandler: function() {
					var $backdrop;
					if (this.parentMenu) {
						$backdrop = this.parentMenu._$backdrop
					} else {
						$backdrop = $('<div>').addClass('.select3-backdrop').css({
							background: 'transparent',
							bottom: 0,
							left: 0,
							position: 'fixed',
							right: 0,
							top: 0,
							zIndex: BACKDROP_Z_INDEX
						});
						$('body').append($backdrop)
					}
					$backdrop.on('click', this.close.bind(this));
					this._$backdrop = $backdrop
				}
			})
		}, {}],
		7: [function(_dereq_, module, exports) {
			'use strict';
			var $ = window.jQuery || window.Zepto;

			function select3(methodName, options) {
				var result;
				this.each(function() {
					var instance = this.select3;
					if (instance) {
						if ($.type(methodName) !== 'string') {
							options = methodName;
							methodName = 'setOptions'
						}
						if ($.type(instance[methodName]) === 'function') {
							if (result === undefined) {
								result = instance[methodName].call(instance, options)
							}
						} else {
							throw new Error('Unknown method: ' + methodName);
						}
					} else {
						if ($.type(methodName) === 'string') {
							if (methodName !== 'destroy') {
								throw new Error('Cannot call method on element without Select3 instance');
							}
						} else {
							options = $.extend({}, methodName, {
								element: this
							});
							var $this = $(this);
							if ($this.is('select') && $this.prop('multiple')) {
								options.multiple = true
							}
							var InputTypes = Select3.InputTypes;
							var InputType = (options.inputType || (options.multiple ? 'Multiple' : 'Single'));
							if ($.type(InputType) !== 'function') {
								if (InputTypes[InputType]) {
									InputType = InputTypes[InputType]
								} else {
									throw new Error('Unknown Select3 input type: ' + InputType);
								}
							}
							this.select3 = new InputType(options)
						}
					}
				});
				return (result === undefined ? this : result)
			}
			function Select3(options) {
				if (!(this instanceof Select3)) {
					return select3.apply(this, arguments)
				}
				this.$el = $(options.element);
				this.$searchInput = null;
				this.dropdown = null;
				this.enabled = true;
				this.hasTouch = (typeof window !== 'undefined' && 'ontouchstart' in window);
				this.hasKeyboard = !this.hasTouch;
				this.items = null;
				this.matcher = Select3.matcher;
				this.options = {};
				this.results = [];
				this.searchInputListeners = Select3.SearchInputListeners;
				this.templates = $.extend({}, Select3.Templates);
				this.term = '';
				this.setOptions(options);
				if (options.value) {
					this.value(options.value, {
						triggerChange: false
					})
				} else {
					this.data(options.data || null, {
						triggerChange: false
					})
				}
				this._events = [];
				this.$el.on('select3-close', this._closed.bind(this));
				this.delegateEvents()
			}
			$.extend(Select3.prototype, {
				$: function(selector) {
					return this.$el.find(selector)
				},
				close: function() {
					if (this.dropdown) {
						this.dropdown.close()
					}
				},
				data: function(newData, options) {
					options = options || {};
					if (newData === undefined) {
						return this._data
					} else {
						newData = this.validateData(newData);
						this._data = newData;
						this._value = this.getValueForData(newData);
						if (options.triggerChange !== false) {
							this.triggerChange()
						}
					}
				},
				delegateEvents: function() {
					this.undelegateEvents();
					$.each(this.events, function(event, listener) {
						var selector, index = event.indexOf(' ');
						if (index > -1) {
							selector = event.slice(index + 1);
							event = event.slice(0, index)
						}
						if ($.type(listener) === 'string') {
							listener = this[listener]
						}
						listener = listener.bind(this);
						if (selector) {
							this.$el.on(event, selector, listener)
						} else {
							this.$el.on(event, listener)
						}
						this._events.push({
							event: event,
							selector: selector,
							listener: listener
						})
					}.bind(this))
				},
				destroy: function() {
					this.undelegateEvents();
					var $el = this.$el;
					$el.children().remove();
					$el[0].select3 = null;
					$el = null
				},
				filterResults: function(results) {
					return results
				},
				focus: function() {
					if (this.$searchInput) {
						this.$searchInput.focus()
					}
				},
				getItemForId: function(id) {
					var items = this.items;
					if (items) {
						return Select3.findNestedById(items, id)
					} else {
						return {
							id: id,
							text: '' + id
						}
					}
				},
				initSearchInput: function($input) {
					this.$searchInput = $input;
					this.searchInputListeners.forEach(function(listener) {
						listener(this, $input)
					}.bind(this));
					$input.on('keyup', function(event) {
						if (!event.isDefaultPrevented()) {
							this.search()
						}
					}.bind(this))
				},
				loadMore: function() {
					this.options.query({
						callback: function(response) {
							if (response && response.results) {
								this._addResults(Select3.processItems(response.results), {
									hasMore: !! response.more
								})
							} else {
								throw new Error('callback must be passed a response object');
							}
						}.bind(this),
						error: this._addResults.bind(this, []),
						offset: this.results.length,
						select3: this,
						term: this.term,
					})
				},
				open: function(options) {
					options = options || {};
					if (!this.dropdown) {
						if (this.triggerEvent('select3-opening')) {
							var Dropdown = this.options.dropdown || Select3.Dropdown;
							if (Dropdown) {
								this.dropdown = new Dropdown({
									position: this.options.positionDropdown,
									select3: this,
									showSearchInput: options.showSearchInput
								})
							}
							this.search('')
						}
					}
				},
				positionDropdown: function() {
					if (this.dropdown) {
						this.dropdown.position()
					}
				},
				search: function(term) {
					var self = this;

					function setResults(results, resultOptions) {
						self._setResults(results, $.extend({
							term: term
						}, resultOptions))
					}
					if (term === undefined) {
						if (!self.$searchInput) {
							return
						}
						term = self.$searchInput.val()
					}
					if (self.items) {
						term = Select3.transformText(term);
						var matcher = self.matcher;
						setResults(self.items.map(function(item) {
							return matcher(item, term)
						}).filter(function(item) {
							return !!item
						}))
					} else if (self.options.query) {
						self.options.query({
							callback: function(response) {
								if (response && response.results) {
									setResults(Select3.processItems(response.results), {
										hasMore: !! response.more
									})
								} else {
									throw new Error('callback must be passed a response object');
								}
							},
							error: self._showError.bind(self),
							offset: 0,
							select3: self,
							term: term,
						})
					}
					self.term = term
				},
				setOptions: function(options) {
					options = options || {};
					Select3.OptionListeners.forEach(function(listener) {
						listener(this, options)
					}.bind(this));
					$.extend(this.options, options);
					var allowedTypes = $.extend({
						closeOnSelect: 'boolean',
						dropdown: 'function|null',
						initSelection: 'function|null',
						matcher: 'function|null',
						placeholder: 'string',
						positionDropdown: 'function|null',
						query: 'function|null',
						readOnly: 'boolean',
						removeOnly: 'boolean',
						searchInputListeners: 'array'
					}, options.allowedTypes);
					$.each(options, function(key, value) {
						var type = allowedTypes[key];
						if (type && !type.split('|').some(function(type) {
							return $.type(value) === type
						})) {
							throw new Error(key + ' must be of type ' + type);
						}
						switch (key) {
						case 'items':
							this.items = (value === null ? value : Select3.processItems(value));
							break;
						case 'matcher':
							this.matcher = value;
							break;
						case 'searchInputListeners':
							this.searchInputListeners = value;
							break;
						case 'templates':
							$.extend(this.templates, value);
							break
						}
					}.bind(this));
					this.enabled = (!this.options.readOnly && !this.options.removeOnly)
				},
				template: function(templateName, options) {
					var template = this.templates[templateName];
					if (template) {
						if ($.type(template) === 'function') {
							return template(options)
						} else if (template.render) {
							return template.render(options)
						} else {
							return template.toString()
						}
					} else {
						throw new Error('Unknown template: ' + templateName);
					}
				},
				triggerChange: function(options) {
					this.triggerEvent('change', $.extend({
						value: this._value
					}, options))
				},
				triggerEvent: function(eventName, data) {
					var event = $.Event(eventName, data || {});
					this.$el.trigger(event);
					return !event.isDefaultPrevented()
				},
				undelegateEvents: function() {
					this._events.forEach(function(event) {
						if (event.selector) {
							this.$el.off(event.event, event.selector, event.listener)
						} else {
							this.$el.off(event.event, event.listener)
						}
					}, this);
					this._events = []
				},
				val: function(newValue) {
					return this.value(newValue)
				},
				validateItem: function(item) {
					if (item && Select3.isValidId(item.id) && $.type(item.text) === 'string') {
						return item
					} else {
						throw new Error('Item should have id (number or string) and text (string) properties');
					}
				},
				value: function(newValue, options) {
					options = options || {};
					if (newValue === undefined) {
						return this._value
					} else {
						newValue = this.validateValue(newValue);
						this._value = newValue;
						if (this.options.initSelection) {
							this.options.initSelection(newValue, function(data) {
								if (this._value === newValue) {
									this._data = this.validateData(data);
									if (options.triggerChange !== false) {
										this.triggerChange()
									}
								}
							}.bind(this))
						} else {
							this._data = this.getDataForValue(newValue);
							if (options.triggerChange !== false) {
								this.triggerChange()
							}
						}
					}
				},
				_addResults: function(results, options) {
					this.results = this.results.concat(results);
					if (this.dropdown) {
						this.dropdown.showResults(this.filterResults(results), $.extend({
							add: true
						}, options))
					}
				},
				_closed: function() {
					this.dropdown = null
				},
				_getItemId: function(elementOrEvent) {
					var $element;
					if (elementOrEvent.target) {
						$element = $(elementOrEvent.target).closest('[data-item-id]')
					} else if (elementOrEvent.length) {
						$element = elementOrEvent
					} else {
						$element = $(elementOrEvent)
					}
					var id = $element.data('item-id');
					if ($.type(id) === 'string') {
						return id
					} else {
						if (Select3.findById(this._data || [], id) || Select3.findNestedById(this.results, id)) {
							return id
						} else {
							return '' + id
						}
					}
				},
				_setResults: function(results, options) {
					this.results = results;
					if (this.dropdown) {
						this.dropdown.showResults(this.filterResults(results), options || {})
					}
				},
				_showError: function(error, options) {
					this.results = [];
					if (this.dropdown) {
						this.dropdown.showError(error, options)
					}
				}
			});
			Select3.Dropdown = null;
			Select3.InputTypes = {};
			Select3.OptionListeners = [];
			Select3.SearchInputListeners = [];
			Select3.Templates = {};
			Select3.findById = function(array, id) {
				var index = Select3.findIndexById(array, id);
				return (index > -1 ? array[index] : null)
			};
			Select3.findIndexById = function(array, id) {
				for (var i = 0, length = array.length; i < length; i++) {
					if (array[i].id === id) {
						return i
					}
				}
				return -1
			};
			Select3.findNestedById = function(array, id) {
				for (var i = 0, length = array.length; i < length; i++) {
					var item = array[i];
					if (item.id === id) {
						return item
					} else if (item.children) {
						var result = Select3.findNestedById(item.children, id);
						if (result) {
							return result
						}
					}
				}
				return null
			};
			Select3.inherits = function(SubClass, SuperClass, prototype) {
				if (arguments.length === 2) {
					prototype = SuperClass;
					SuperClass = Select3
				}
				SubClass.prototype = $.extend(Object.create(SuperClass.prototype), {
					constructor: SubClass
				}, prototype);
				return function(self, methodName) {
					SuperClass.prototype[methodName].apply(self, Array.prototype.slice.call(arguments, 2))
				}
			};
			Select3.isValidId = function(id) {
				var type = $.type(id);
				return type === 'number' || type === 'string'
			};
			Select3.matcher = function(item, term) {
				var result = null;
				if (Select3.transformText(item.text).indexOf(term) > -1) {
					result = item
				} else if (item.children) {
					var matchingChildren = item.children.map(function(child) {
						return Select3.matcher(child, term)
					}).filter(function(child) {
						return !!child
					});
					if (matchingChildren.length) {
						result = {
							id: item.id,
							text: item.text,
							children: matchingChildren
						}
					}
				}
				return result
			};
			Select3.processItem = function(item) {
				if (Select3.isValidId(item)) {
					return {
						id: item,
						text: '' + item
					}
				} else if (item && (Select3.isValidId(item.id) || item.children) && $.type(item.text) === 'string') {
					if (item.children) {
						item.children = Select3.processItems(item.children)
					}
					return item
				} else {
					throw new Error('invalid item');
				}
			};
			Select3.processItems = function(items) {
				if ($.type(items) === 'array') {
					return items.map(Select3.processItem)
				} else {
					throw new Error('invalid items');
				}
			};
			Select3.quoteCssAttr = function(string) {
				return '"' + ('' + string).replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"'
			};
			Select3.transformText = function(string) {
				return string.toLowerCase()
			};
			module.exports = $.fn.select3 = Select3
		}, {}],
		8: [function(_dereq_, module, exports) {
			'use strict';
			var DIACRITICS = {
				'\u24B6': 'A',
				'\uFF21': 'A',
				'\u00C0': 'A',
				'\u00C1': 'A',
				'\u00C2': 'A',
				'\u1EA6': 'A',
				'\u1EA4': 'A',
				'\u1EAA': 'A',
				'\u1EA8': 'A',
				'\u00C3': 'A',
				'\u0100': 'A',
				'\u0102': 'A',
				'\u1EB0': 'A',
				'\u1EAE': 'A',
				'\u1EB4': 'A',
				'\u1EB2': 'A',
				'\u0226': 'A',
				'\u01E0': 'A',
				'\u00C4': 'A',
				'\u01DE': 'A',
				'\u1EA2': 'A',
				'\u00C5': 'A',
				'\u01FA': 'A',
				'\u01CD': 'A',
				'\u0200': 'A',
				'\u0202': 'A',
				'\u1EA0': 'A',
				'\u1EAC': 'A',
				'\u1EB6': 'A',
				'\u1E00': 'A',
				'\u0104': 'A',
				'\u023A': 'A',
				'\u2C6F': 'A',
				'\uA732': 'AA',
				'\u00C6': 'AE',
				'\u01FC': 'AE',
				'\u01E2': 'AE',
				'\uA734': 'AO',
				'\uA736': 'AU',
				'\uA738': 'AV',
				'\uA73A': 'AV',
				'\uA73C': 'AY',
				'\u24B7': 'B',
				'\uFF22': 'B',
				'\u1E02': 'B',
				'\u1E04': 'B',
				'\u1E06': 'B',
				'\u0243': 'B',
				'\u0182': 'B',
				'\u0181': 'B',
				'\u24B8': 'C',
				'\uFF23': 'C',
				'\u0106': 'C',
				'\u0108': 'C',
				'\u010A': 'C',
				'\u010C': 'C',
				'\u00C7': 'C',
				'\u1E08': 'C',
				'\u0187': 'C',
				'\u023B': 'C',
				'\uA73E': 'C',
				'\u24B9': 'D',
				'\uFF24': 'D',
				'\u1E0A': 'D',
				'\u010E': 'D',
				'\u1E0C': 'D',
				'\u1E10': 'D',
				'\u1E12': 'D',
				'\u1E0E': 'D',
				'\u0110': 'D',
				'\u018B': 'D',
				'\u018A': 'D',
				'\u0189': 'D',
				'\uA779': 'D',
				'\u01F1': 'DZ',
				'\u01C4': 'DZ',
				'\u01F2': 'Dz',
				'\u01C5': 'Dz',
				'\u24BA': 'E',
				'\uFF25': 'E',
				'\u00C8': 'E',
				'\u00C9': 'E',
				'\u00CA': 'E',
				'\u1EC0': 'E',
				'\u1EBE': 'E',
				'\u1EC4': 'E',
				'\u1EC2': 'E',
				'\u1EBC': 'E',
				'\u0112': 'E',
				'\u1E14': 'E',
				'\u1E16': 'E',
				'\u0114': 'E',
				'\u0116': 'E',
				'\u00CB': 'E',
				'\u1EBA': 'E',
				'\u011A': 'E',
				'\u0204': 'E',
				'\u0206': 'E',
				'\u1EB8': 'E',
				'\u1EC6': 'E',
				'\u0228': 'E',
				'\u1E1C': 'E',
				'\u0118': 'E',
				'\u1E18': 'E',
				'\u1E1A': 'E',
				'\u0190': 'E',
				'\u018E': 'E',
				'\u24BB': 'F',
				'\uFF26': 'F',
				'\u1E1E': 'F',
				'\u0191': 'F',
				'\uA77B': 'F',
				'\u24BC': 'G',
				'\uFF27': 'G',
				'\u01F4': 'G',
				'\u011C': 'G',
				'\u1E20': 'G',
				'\u011E': 'G',
				'\u0120': 'G',
				'\u01E6': 'G',
				'\u0122': 'G',
				'\u01E4': 'G',
				'\u0193': 'G',
				'\uA7A0': 'G',
				'\uA77D': 'G',
				'\uA77E': 'G',
				'\u24BD': 'H',
				'\uFF28': 'H',
				'\u0124': 'H',
				'\u1E22': 'H',
				'\u1E26': 'H',
				'\u021E': 'H',
				'\u1E24': 'H',
				'\u1E28': 'H',
				'\u1E2A': 'H',
				'\u0126': 'H',
				'\u2C67': 'H',
				'\u2C75': 'H',
				'\uA78D': 'H',
				'\u24BE': 'I',
				'\uFF29': 'I',
				'\u00CC': 'I',
				'\u00CD': 'I',
				'\u00CE': 'I',
				'\u0128': 'I',
				'\u012A': 'I',
				'\u012C': 'I',
				'\u0130': 'I',
				'\u00CF': 'I',
				'\u1E2E': 'I',
				'\u1EC8': 'I',
				'\u01CF': 'I',
				'\u0208': 'I',
				'\u020A': 'I',
				'\u1ECA': 'I',
				'\u012E': 'I',
				'\u1E2C': 'I',
				'\u0197': 'I',
				'\u24BF': 'J',
				'\uFF2A': 'J',
				'\u0134': 'J',
				'\u0248': 'J',
				'\u24C0': 'K',
				'\uFF2B': 'K',
				'\u1E30': 'K',
				'\u01E8': 'K',
				'\u1E32': 'K',
				'\u0136': 'K',
				'\u1E34': 'K',
				'\u0198': 'K',
				'\u2C69': 'K',
				'\uA740': 'K',
				'\uA742': 'K',
				'\uA744': 'K',
				'\uA7A2': 'K',
				'\u24C1': 'L',
				'\uFF2C': 'L',
				'\u013F': 'L',
				'\u0139': 'L',
				'\u013D': 'L',
				'\u1E36': 'L',
				'\u1E38': 'L',
				'\u013B': 'L',
				'\u1E3C': 'L',
				'\u1E3A': 'L',
				'\u0141': 'L',
				'\u023D': 'L',
				'\u2C62': 'L',
				'\u2C60': 'L',
				'\uA748': 'L',
				'\uA746': 'L',
				'\uA780': 'L',
				'\u01C7': 'LJ',
				'\u01C8': 'Lj',
				'\u24C2': 'M',
				'\uFF2D': 'M',
				'\u1E3E': 'M',
				'\u1E40': 'M',
				'\u1E42': 'M',
				'\u2C6E': 'M',
				'\u019C': 'M',
				'\u24C3': 'N',
				'\uFF2E': 'N',
				'\u01F8': 'N',
				'\u0143': 'N',
				'\u00D1': 'N',
				'\u1E44': 'N',
				'\u0147': 'N',
				'\u1E46': 'N',
				'\u0145': 'N',
				'\u1E4A': 'N',
				'\u1E48': 'N',
				'\u0220': 'N',
				'\u019D': 'N',
				'\uA790': 'N',
				'\uA7A4': 'N',
				'\u01CA': 'NJ',
				'\u01CB': 'Nj',
				'\u24C4': 'O',
				'\uFF2F': 'O',
				'\u00D2': 'O',
				'\u00D3': 'O',
				'\u00D4': 'O',
				'\u1ED2': 'O',
				'\u1ED0': 'O',
				'\u1ED6': 'O',
				'\u1ED4': 'O',
				'\u00D5': 'O',
				'\u1E4C': 'O',
				'\u022C': 'O',
				'\u1E4E': 'O',
				'\u014C': 'O',
				'\u1E50': 'O',
				'\u1E52': 'O',
				'\u014E': 'O',
				'\u022E': 'O',
				'\u0230': 'O',
				'\u00D6': 'O',
				'\u022A': 'O',
				'\u1ECE': 'O',
				'\u0150': 'O',
				'\u01D1': 'O',
				'\u020C': 'O',
				'\u020E': 'O',
				'\u01A0': 'O',
				'\u1EDC': 'O',
				'\u1EDA': 'O',
				'\u1EE0': 'O',
				'\u1EDE': 'O',
				'\u1EE2': 'O',
				'\u1ECC': 'O',
				'\u1ED8': 'O',
				'\u01EA': 'O',
				'\u01EC': 'O',
				'\u00D8': 'O',
				'\u01FE': 'O',
				'\u0186': 'O',
				'\u019F': 'O',
				'\uA74A': 'O',
				'\uA74C': 'O',
				'\u01A2': 'OI',
				'\uA74E': 'OO',
				'\u0222': 'OU',
				'\u24C5': 'P',
				'\uFF30': 'P',
				'\u1E54': 'P',
				'\u1E56': 'P',
				'\u01A4': 'P',
				'\u2C63': 'P',
				'\uA750': 'P',
				'\uA752': 'P',
				'\uA754': 'P',
				'\u24C6': 'Q',
				'\uFF31': 'Q',
				'\uA756': 'Q',
				'\uA758': 'Q',
				'\u024A': 'Q',
				'\u24C7': 'R',
				'\uFF32': 'R',
				'\u0154': 'R',
				'\u1E58': 'R',
				'\u0158': 'R',
				'\u0210': 'R',
				'\u0212': 'R',
				'\u1E5A': 'R',
				'\u1E5C': 'R',
				'\u0156': 'R',
				'\u1E5E': 'R',
				'\u024C': 'R',
				'\u2C64': 'R',
				'\uA75A': 'R',
				'\uA7A6': 'R',
				'\uA782': 'R',
				'\u24C8': 'S',
				'\uFF33': 'S',
				'\u1E9E': 'S',
				'\u015A': 'S',
				'\u1E64': 'S',
				'\u015C': 'S',
				'\u1E60': 'S',
				'\u0160': 'S',
				'\u1E66': 'S',
				'\u1E62': 'S',
				'\u1E68': 'S',
				'\u0218': 'S',
				'\u015E': 'S',
				'\u2C7E': 'S',
				'\uA7A8': 'S',
				'\uA784': 'S',
				'\u24C9': 'T',
				'\uFF34': 'T',
				'\u1E6A': 'T',
				'\u0164': 'T',
				'\u1E6C': 'T',
				'\u021A': 'T',
				'\u0162': 'T',
				'\u1E70': 'T',
				'\u1E6E': 'T',
				'\u0166': 'T',
				'\u01AC': 'T',
				'\u01AE': 'T',
				'\u023E': 'T',
				'\uA786': 'T',
				'\uA728': 'TZ',
				'\u24CA': 'U',
				'\uFF35': 'U',
				'\u00D9': 'U',
				'\u00DA': 'U',
				'\u00DB': 'U',
				'\u0168': 'U',
				'\u1E78': 'U',
				'\u016A': 'U',
				'\u1E7A': 'U',
				'\u016C': 'U',
				'\u00DC': 'U',
				'\u01DB': 'U',
				'\u01D7': 'U',
				'\u01D5': 'U',
				'\u01D9': 'U',
				'\u1EE6': 'U',
				'\u016E': 'U',
				'\u0170': 'U',
				'\u01D3': 'U',
				'\u0214': 'U',
				'\u0216': 'U',
				'\u01AF': 'U',
				'\u1EEA': 'U',
				'\u1EE8': 'U',
				'\u1EEE': 'U',
				'\u1EEC': 'U',
				'\u1EF0': 'U',
				'\u1EE4': 'U',
				'\u1E72': 'U',
				'\u0172': 'U',
				'\u1E76': 'U',
				'\u1E74': 'U',
				'\u0244': 'U',
				'\u24CB': 'V',
				'\uFF36': 'V',
				'\u1E7C': 'V',
				'\u1E7E': 'V',
				'\u01B2': 'V',
				'\uA75E': 'V',
				'\u0245': 'V',
				'\uA760': 'VY',
				'\u24CC': 'W',
				'\uFF37': 'W',
				'\u1E80': 'W',
				'\u1E82': 'W',
				'\u0174': 'W',
				'\u1E86': 'W',
				'\u1E84': 'W',
				'\u1E88': 'W',
				'\u2C72': 'W',
				'\u24CD': 'X',
				'\uFF38': 'X',
				'\u1E8A': 'X',
				'\u1E8C': 'X',
				'\u24CE': 'Y',
				'\uFF39': 'Y',
				'\u1EF2': 'Y',
				'\u00DD': 'Y',
				'\u0176': 'Y',
				'\u1EF8': 'Y',
				'\u0232': 'Y',
				'\u1E8E': 'Y',
				'\u0178': 'Y',
				'\u1EF6': 'Y',
				'\u1EF4': 'Y',
				'\u01B3': 'Y',
				'\u024E': 'Y',
				'\u1EFE': 'Y',
				'\u24CF': 'Z',
				'\uFF3A': 'Z',
				'\u0179': 'Z',
				'\u1E90': 'Z',
				'\u017B': 'Z',
				'\u017D': 'Z',
				'\u1E92': 'Z',
				'\u1E94': 'Z',
				'\u01B5': 'Z',
				'\u0224': 'Z',
				'\u2C7F': 'Z',
				'\u2C6B': 'Z',
				'\uA762': 'Z',
				'\u24D0': 'a',
				'\uFF41': 'a',
				'\u1E9A': 'a',
				'\u00E0': 'a',
				'\u00E1': 'a',
				'\u00E2': 'a',
				'\u1EA7': 'a',
				'\u1EA5': 'a',
				'\u1EAB': 'a',
				'\u1EA9': 'a',
				'\u00E3': 'a',
				'\u0101': 'a',
				'\u0103': 'a',
				'\u1EB1': 'a',
				'\u1EAF': 'a',
				'\u1EB5': 'a',
				'\u1EB3': 'a',
				'\u0227': 'a',
				'\u01E1': 'a',
				'\u00E4': 'a',
				'\u01DF': 'a',
				'\u1EA3': 'a',
				'\u00E5': 'a',
				'\u01FB': 'a',
				'\u01CE': 'a',
				'\u0201': 'a',
				'\u0203': 'a',
				'\u1EA1': 'a',
				'\u1EAD': 'a',
				'\u1EB7': 'a',
				'\u1E01': 'a',
				'\u0105': 'a',
				'\u2C65': 'a',
				'\u0250': 'a',
				'\uA733': 'aa',
				'\u00E6': 'ae',
				'\u01FD': 'ae',
				'\u01E3': 'ae',
				'\uA735': 'ao',
				'\uA737': 'au',
				'\uA739': 'av',
				'\uA73B': 'av',
				'\uA73D': 'ay',
				'\u24D1': 'b',
				'\uFF42': 'b',
				'\u1E03': 'b',
				'\u1E05': 'b',
				'\u1E07': 'b',
				'\u0180': 'b',
				'\u0183': 'b',
				'\u0253': 'b',
				'\u24D2': 'c',
				'\uFF43': 'c',
				'\u0107': 'c',
				'\u0109': 'c',
				'\u010B': 'c',
				'\u010D': 'c',
				'\u00E7': 'c',
				'\u1E09': 'c',
				'\u0188': 'c',
				'\u023C': 'c',
				'\uA73F': 'c',
				'\u2184': 'c',
				'\u24D3': 'd',
				'\uFF44': 'd',
				'\u1E0B': 'd',
				'\u010F': 'd',
				'\u1E0D': 'd',
				'\u1E11': 'd',
				'\u1E13': 'd',
				'\u1E0F': 'd',
				'\u0111': 'd',
				'\u018C': 'd',
				'\u0256': 'd',
				'\u0257': 'd',
				'\uA77A': 'd',
				'\u01F3': 'dz',
				'\u01C6': 'dz',
				'\u24D4': 'e',
				'\uFF45': 'e',
				'\u00E8': 'e',
				'\u00E9': 'e',
				'\u00EA': 'e',
				'\u1EC1': 'e',
				'\u1EBF': 'e',
				'\u1EC5': 'e',
				'\u1EC3': 'e',
				'\u1EBD': 'e',
				'\u0113': 'e',
				'\u1E15': 'e',
				'\u1E17': 'e',
				'\u0115': 'e',
				'\u0117': 'e',
				'\u00EB': 'e',
				'\u1EBB': 'e',
				'\u011B': 'e',
				'\u0205': 'e',
				'\u0207': 'e',
				'\u1EB9': 'e',
				'\u1EC7': 'e',
				'\u0229': 'e',
				'\u1E1D': 'e',
				'\u0119': 'e',
				'\u1E19': 'e',
				'\u1E1B': 'e',
				'\u0247': 'e',
				'\u025B': 'e',
				'\u01DD': 'e',
				'\u24D5': 'f',
				'\uFF46': 'f',
				'\u1E1F': 'f',
				'\u0192': 'f',
				'\uA77C': 'f',
				'\u24D6': 'g',
				'\uFF47': 'g',
				'\u01F5': 'g',
				'\u011D': 'g',
				'\u1E21': 'g',
				'\u011F': 'g',
				'\u0121': 'g',
				'\u01E7': 'g',
				'\u0123': 'g',
				'\u01E5': 'g',
				'\u0260': 'g',
				'\uA7A1': 'g',
				'\u1D79': 'g',
				'\uA77F': 'g',
				'\u24D7': 'h',
				'\uFF48': 'h',
				'\u0125': 'h',
				'\u1E23': 'h',
				'\u1E27': 'h',
				'\u021F': 'h',
				'\u1E25': 'h',
				'\u1E29': 'h',
				'\u1E2B': 'h',
				'\u1E96': 'h',
				'\u0127': 'h',
				'\u2C68': 'h',
				'\u2C76': 'h',
				'\u0265': 'h',
				'\u0195': 'hv',
				'\u24D8': 'i',
				'\uFF49': 'i',
				'\u00EC': 'i',
				'\u00ED': 'i',
				'\u00EE': 'i',
				'\u0129': 'i',
				'\u012B': 'i',
				'\u012D': 'i',
				'\u00EF': 'i',
				'\u1E2F': 'i',
				'\u1EC9': 'i',
				'\u01D0': 'i',
				'\u0209': 'i',
				'\u020B': 'i',
				'\u1ECB': 'i',
				'\u012F': 'i',
				'\u1E2D': 'i',
				'\u0268': 'i',
				'\u0131': 'i',
				'\u24D9': 'j',
				'\uFF4A': 'j',
				'\u0135': 'j',
				'\u01F0': 'j',
				'\u0249': 'j',
				'\u24DA': 'k',
				'\uFF4B': 'k',
				'\u1E31': 'k',
				'\u01E9': 'k',
				'\u1E33': 'k',
				'\u0137': 'k',
				'\u1E35': 'k',
				'\u0199': 'k',
				'\u2C6A': 'k',
				'\uA741': 'k',
				'\uA743': 'k',
				'\uA745': 'k',
				'\uA7A3': 'k',
				'\u24DB': 'l',
				'\uFF4C': 'l',
				'\u0140': 'l',
				'\u013A': 'l',
				'\u013E': 'l',
				'\u1E37': 'l',
				'\u1E39': 'l',
				'\u013C': 'l',
				'\u1E3D': 'l',
				'\u1E3B': 'l',
				'\u017F': 'l',
				'\u0142': 'l',
				'\u019A': 'l',
				'\u026B': 'l',
				'\u2C61': 'l',
				'\uA749': 'l',
				'\uA781': 'l',
				'\uA747': 'l',
				'\u01C9': 'lj',
				'\u24DC': 'm',
				'\uFF4D': 'm',
				'\u1E3F': 'm',
				'\u1E41': 'm',
				'\u1E43': 'm',
				'\u0271': 'm',
				'\u026F': 'm',
				'\u24DD': 'n',
				'\uFF4E': 'n',
				'\u01F9': 'n',
				'\u0144': 'n',
				'\u00F1': 'n',
				'\u1E45': 'n',
				'\u0148': 'n',
				'\u1E47': 'n',
				'\u0146': 'n',
				'\u1E4B': 'n',
				'\u1E49': 'n',
				'\u019E': 'n',
				'\u0272': 'n',
				'\u0149': 'n',
				'\uA791': 'n',
				'\uA7A5': 'n',
				'\u01CC': 'nj',
				'\u24DE': 'o',
				'\uFF4F': 'o',
				'\u00F2': 'o',
				'\u00F3': 'o',
				'\u00F4': 'o',
				'\u1ED3': 'o',
				'\u1ED1': 'o',
				'\u1ED7': 'o',
				'\u1ED5': 'o',
				'\u00F5': 'o',
				'\u1E4D': 'o',
				'\u022D': 'o',
				'\u1E4F': 'o',
				'\u014D': 'o',
				'\u1E51': 'o',
				'\u1E53': 'o',
				'\u014F': 'o',
				'\u022F': 'o',
				'\u0231': 'o',
				'\u00F6': 'o',
				'\u022B': 'o',
				'\u1ECF': 'o',
				'\u0151': 'o',
				'\u01D2': 'o',
				'\u020D': 'o',
				'\u020F': 'o',
				'\u01A1': 'o',
				'\u1EDD': 'o',
				'\u1EDB': 'o',
				'\u1EE1': 'o',
				'\u1EDF': 'o',
				'\u1EE3': 'o',
				'\u1ECD': 'o',
				'\u1ED9': 'o',
				'\u01EB': 'o',
				'\u01ED': 'o',
				'\u00F8': 'o',
				'\u01FF': 'o',
				'\u0254': 'o',
				'\uA74B': 'o',
				'\uA74D': 'o',
				'\u0275': 'o',
				'\u01A3': 'oi',
				'\u0223': 'ou',
				'\uA74F': 'oo',
				'\u24DF': 'p',
				'\uFF50': 'p',
				'\u1E55': 'p',
				'\u1E57': 'p',
				'\u01A5': 'p',
				'\u1D7D': 'p',
				'\uA751': 'p',
				'\uA753': 'p',
				'\uA755': 'p',
				'\u24E0': 'q',
				'\uFF51': 'q',
				'\u024B': 'q',
				'\uA757': 'q',
				'\uA759': 'q',
				'\u24E1': 'r',
				'\uFF52': 'r',
				'\u0155': 'r',
				'\u1E59': 'r',
				'\u0159': 'r',
				'\u0211': 'r',
				'\u0213': 'r',
				'\u1E5B': 'r',
				'\u1E5D': 'r',
				'\u0157': 'r',
				'\u1E5F': 'r',
				'\u024D': 'r',
				'\u027D': 'r',
				'\uA75B': 'r',
				'\uA7A7': 'r',
				'\uA783': 'r',
				'\u24E2': 's',
				'\uFF53': 's',
				'\u00DF': 's',
				'\u015B': 's',
				'\u1E65': 's',
				'\u015D': 's',
				'\u1E61': 's',
				'\u0161': 's',
				'\u1E67': 's',
				'\u1E63': 's',
				'\u1E69': 's',
				'\u0219': 's',
				'\u015F': 's',
				'\u023F': 's',
				'\uA7A9': 's',
				'\uA785': 's',
				'\u1E9B': 's',
				'\u24E3': 't',
				'\uFF54': 't',
				'\u1E6B': 't',
				'\u1E97': 't',
				'\u0165': 't',
				'\u1E6D': 't',
				'\u021B': 't',
				'\u0163': 't',
				'\u1E71': 't',
				'\u1E6F': 't',
				'\u0167': 't',
				'\u01AD': 't',
				'\u0288': 't',
				'\u2C66': 't',
				'\uA787': 't',
				'\uA729': 'tz',
				'\u24E4': 'u',
				'\uFF55': 'u',
				'\u00F9': 'u',
				'\u00FA': 'u',
				'\u00FB': 'u',
				'\u0169': 'u',
				'\u1E79': 'u',
				'\u016B': 'u',
				'\u1E7B': 'u',
				'\u016D': 'u',
				'\u00FC': 'u',
				'\u01DC': 'u',
				'\u01D8': 'u',
				'\u01D6': 'u',
				'\u01DA': 'u',
				'\u1EE7': 'u',
				'\u016F': 'u',
				'\u0171': 'u',
				'\u01D4': 'u',
				'\u0215': 'u',
				'\u0217': 'u',
				'\u01B0': 'u',
				'\u1EEB': 'u',
				'\u1EE9': 'u',
				'\u1EEF': 'u',
				'\u1EED': 'u',
				'\u1EF1': 'u',
				'\u1EE5': 'u',
				'\u1E73': 'u',
				'\u0173': 'u',
				'\u1E77': 'u',
				'\u1E75': 'u',
				'\u0289': 'u',
				'\u24E5': 'v',
				'\uFF56': 'v',
				'\u1E7D': 'v',
				'\u1E7F': 'v',
				'\u028B': 'v',
				'\uA75F': 'v',
				'\u028C': 'v',
				'\uA761': 'vy',
				'\u24E6': 'w',
				'\uFF57': 'w',
				'\u1E81': 'w',
				'\u1E83': 'w',
				'\u0175': 'w',
				'\u1E87': 'w',
				'\u1E85': 'w',
				'\u1E98': 'w',
				'\u1E89': 'w',
				'\u2C73': 'w',
				'\u24E7': 'x',
				'\uFF58': 'x',
				'\u1E8B': 'x',
				'\u1E8D': 'x',
				'\u24E8': 'y',
				'\uFF59': 'y',
				'\u1EF3': 'y',
				'\u00FD': 'y',
				'\u0177': 'y',
				'\u1EF9': 'y',
				'\u0233': 'y',
				'\u1E8F': 'y',
				'\u00FF': 'y',
				'\u1EF7': 'y',
				'\u1E99': 'y',
				'\u1EF5': 'y',
				'\u01B4': 'y',
				'\u024F': 'y',
				'\u1EFF': 'y',
				'\u24E9': 'z',
				'\uFF5A': 'z',
				'\u017A': 'z',
				'\u1E91': 'z',
				'\u017C': 'z',
				'\u017E': 'z',
				'\u1E93': 'z',
				'\u1E95': 'z',
				'\u01B6': 'z',
				'\u0225': 'z',
				'\u0240': 'z',
				'\u2C6C': 'z',
				'\uA763': 'z',
				'\u0386': '\u0391',
				'\u0388': '\u0395',
				'\u0389': '\u0397',
				'\u038A': '\u0399',
				'\u03AA': '\u0399',
				'\u038C': '\u039F',
				'\u038E': '\u03A5',
				'\u03AB': '\u03A5',
				'\u038F': '\u03A9',
				'\u03AC': '\u03B1',
				'\u03AD': '\u03B5',
				'\u03AE': '\u03B7',
				'\u03AF': '\u03B9',
				'\u03CA': '\u03B9',
				'\u0390': '\u03B9',
				'\u03CC': '\u03BF',
				'\u03CD': '\u03C5',
				'\u03CB': '\u03C5',
				'\u03B0': '\u03C5',
				'\u03C9': '\u03C9',
				'\u03C2': '\u03C3'
			};
			var Select3 = _dereq_(7);
			var previousTransform = Select3.transformText;
			Select3.transformText = function(string) {
				var result = '';
				for (var i = 0, length = string.length; i < length; i++) {
					var character = string[i];
					result += DIACRITICS[character] || character
				}
				return previousTransform(result)
			}
		}, {}],
		9: [function(_dereq_, module, exports) {
			'use strict';
			var $ = window.jQuery || window.Zepto;
			var debounce = _dereq_(2);
			var Select3 = _dereq_(7);

			function findElementIndex($elements, selector) {
				for (var i = 0, length = $elements.length; i < length; i++) {
					if ($elements.eq(i).is(selector)) {
						return i
					}
				}
				return -1
			}
			function Select3Dropdown(options) {
				var select3 = options.select3;
				this.$el = $(select3.template('dropdown', {
					dropdownCssClass: select3.options.dropdownCssClass,
					searchInputPlaceholder: select3.options.searchInputPlaceholder,
					showSearchInput: options.showSearchInput
				}));
				this.$results = this.$('.select3-results-container');
				this.hasMore = false;
				this.highlightedResult = null;
				this.loadMoreHighlighted = false;
				this.options = options;
				this.results = [];
				this.select3 = select3;
				this._closeProxy = this.close.bind(this);
				if (select3.options.closeOnSelect !== false) {
					select3.$el.on('select3-selecting', this._closeProxy)
				}
				this.addToDom();
				this.position();
				this.setupCloseHandler();
				this._scrolledProxy = debounce(this._scrolled.bind(this), 50);
				this._suppressMouseWheel();
				if (options.showSearchInput) {
					select3.initSearchInput(this.$('.select3-search-input'));
					select3.focus()
				}
				this._delegateEvents();
				this.showLoading();
				this.triggerOpen()
			}
			$.extend(Select3Dropdown.prototype, {
				$: function(selector) {
					return this.$el.find(selector)
				},
				addToDom: function() {
					this.$el.appendTo(this.select3.$el[0].ownerDocument.body)
				},
				close: function() {
					this.$el.remove();
					this.removeCloseHandler();
					this.select3.$el.off('select3-selecting', this._closeProxy);
					this.triggerClose()
				},
				events: {
					'click .select3-load-more': '_loadMoreClicked',
					'click .select3-result-item': '_resultClicked',
					'mouseenter .select3-load-more': 'highlightLoadMore',
					'mouseenter .select3-result-item': '_resultHovered'
				},
				highlight: function(item) {
					if (this.loadMoreHighlighted) {
						this.$('.select3-load-more').removeClass('highlight')
					}
					this.$('.select3-result-item').removeClass('highlight').filter('[data-item-id=' + Select3.quoteCssAttr(item.id) + ']').addClass('highlight');
					this.highlightedResult = item;
					this.loadMoreHighlighted = false;
					this.select3.triggerEvent('select3-highlight', {
						item: item,
						id: item.id
					})
				},
				highlightLoadMore: function() {
					this.$('.select3-result-item').removeClass('highlight');
					this.$('.select3-load-more').addClass('highlight');
					this.highlightedResult = null;
					this.loadMoreHighlighted = true
				},
				highlightNext: function() {
					var results = this.results;
					if (results.length) {
						var $results = this.$('.select3-result-item');
						var index = 0;
						var highlightedResult = this.highlightedResult;
						if (highlightedResult) {
							var quotedId = Select3.quoteCssAttr(highlightedResult.id);
							index = findElementIndex($results, '[data-item-id=' + quotedId + ']') + 1;
							if (index >= $results.length) {
								if (this.hasMore) {
									this.highlightLoadMore();
									this._scrollToHighlight({
										alignToTop: false
									});
									return
								} else {
									index = 0
								}
							}
						}
						var result = Select3.findNestedById(results, this.select3._getItemId($results[index]));
						if (result) {
							this.highlight(result);
							this._scrollToHighlight({
								alignToTop: false
							})
						}
					}
				},
				highlightPrevious: function() {
					var results = this.results;
					if (results.length) {
						var $results = this.$('.select3-result-item');
						var index = $results.length - 1;
						var highlightedResult = this.highlightedResult;
						if (highlightedResult) {
							var quotedId = Select3.quoteCssAttr(highlightedResult.id);
							index = findElementIndex($results, '[data-item-id=' + quotedId + ']') - 1;
							if (index < 0) {
								if (this.hasMore) {
									this.highlightLoadMore();
									this._scrollToHighlight({
										alignToTop: true
									});
									return
								} else {
									index = $results.length - 1
								}
							}
						}
						var result = Select3.findNestedById(results, this.select3._getItemId($results[index]));
						if (result) {
							this.highlight(result);
							this._scrollToHighlight({
								alignToTop: true
							})
						}
					}
				},
				position: function() {
					var position = this.options.position;
					if (position) {
						position(this.$el, this.select3.$el)
					}
					this._scrolled()
				},
				removeCloseHandler: function() {
					$('body').off('click', this._closeProxy)
				},
				renderItems: function(items) {
					var select3 = this.select3;
					return items.map(function(item) {
						var result = select3.template(item.id ? 'resultItem' : 'resultLabel', item);
						if (item.children) {
							result += select3.template('resultChildren', {
								childrenHtml: this.renderItems(item.children)
							})
						}
						return result
					}, this).join('')
				},
				selectHighlight: function() {
					if (this.highlightedResult) {
						this.selectItem(this.highlightedResult.id)
					} else if (this.loadMoreHighlighted) {
						this._loadMoreClicked()
					}
				},
				selectItem: function(id) {
					var select3 = this.select3;
					var item = Select3.findNestedById(select3.results, id);
					if (item) {
						var options = {
							id: id,
							item: item
						};
						if (select3.triggerEvent('select3-selecting', options)) {
							select3.triggerEvent('select3-selected', options)
						}
					}
				},
				setupCloseHandler: function() {
					$('body').on('click', this._closeProxy)
				},
				showError: function(message, options) {
					options = options || {};
					this.$results.html(this.select3.template('error', {
						escape: options.escape !== false,
						message: message,
					}));
					this.hasMore = false;
					this.results = [];
					this.highlightedResult = null;
					this.loadMoreHighlighted = false;
					this.position()
				},
				showLoading: function() {
					this.$results.html(this.select3.template('loading'));
					this.hasMore = false;
					this.results = [];
					this.highlightedResult = null;
					this.loadMoreHighlighted = false;
					this.position()
				},
				showResults: function(results, options) {
					var resultsHtml = this.renderItems(results);
					if (options.hasMore) {
						resultsHtml += this.select3.template('loadMore')
					} else {
						if (!resultsHtml && !options.add) {
							resultsHtml = this.select3.template('noResults', {
								term: options.term
							})
						}
					}
					if (options.add) {
						this.$('.select3-loading').replaceWith(resultsHtml);
						this.results = this.results.concat(results)
					} else {
						this.$results.html(resultsHtml);
						this.results = results
					}
					this.hasMore = options.hasMore;
					if (!options.add || this.loadMoreHighlighted) {
						this._highlightFirstItem(results)
					}
					this.position()
				},
				triggerClose: function() {
					this.select3.$el.trigger('select3-close')
				},
				triggerOpen: function() {
					this.select3.$el.trigger('select3-open')
				},
				_delegateEvents: function() {
					$.each(this.events, function(event, listener) {
						var index = event.indexOf(' ');
						var selector = event.slice(index + 1);
						event = event.slice(0, index);
						if ($.type(listener) === 'string') {
							listener = this[listener]
						}
						listener = listener.bind(this);
						this.$el.on(event, selector, listener)
					}.bind(this));
					this.$results.on('scroll touchmove touchend', this._scrolledProxy)
				},
				_highlightFirstItem: function(results) {
					function findFirstItem(results) {
						for (var i = 0, length = results.length; i < length; i++) {
							var result = results[i];
							if (result.id) {
								return result
							} else if (result.children) {
								var item = findFirstItem(result.children);
								if (item) {
									return item
								}
							}
						}
					}
					var firstItem = findFirstItem(results);
					if (firstItem) {
						this.highlight(firstItem)
					} else {
						this.highlightedResult = null;
						this.loadMoreHighlighted = false
					}
				},
				_loadMoreClicked: function() {
					this.$('.select3-load-more').replaceWith(this.select3.template('loading'));
					this.select3.loadMore();
					this.select3.focus();
					return false
				},
				_resultClicked: function(event) {
					this.selectItem(this.select3._getItemId(event));
					return false
				},
				_resultHovered: function(event) {
					var id = this.select3._getItemId(event);
					var item = Select3.findNestedById(this.results, id);
					if (item) {
						this.highlight(item)
					}
				},
				_scrolled: function() {
					var $loadMore = this.$('.select3-load-more');
					if ($loadMore.length) {
						if ($loadMore[0].offsetTop - this.$results[0].scrollTop < this.$el.height()) {
							this._loadMoreClicked()
						}
					}
				},
				_scrollToHighlight: function(options) {
					var el;
					if (this.highlightedResult) {
						var quotedId = Select3.quoteCssAttr(this.highlightedResult.id);
						el = this.$('.select3-result-item[data-item-id=' + quotedId + ']')[0]
					} else if (this.loadMoreHighlighted) {
						el = this.$('.select3-load-more')[0]
					} else {
						return
					}
					var rect = el.getBoundingClientRect(),
						containerRect = this.$results[0].getBoundingClientRect();
					if (rect.top < containerRect.top || rect.bottom > containerRect.bottom) {
						el.scrollIntoView(options.alignToTop)
					}
				},
				_suppressMouseWheel: function() {
					var suppressMouseWheelSelector = this.select3.options.suppressMouseWheelSelector;
					if (suppressMouseWheelSelector === null) {
						return
					}
					var selector = suppressMouseWheelSelector || '.select3-results-container';
					this.$el.on('DOMMouseScroll mousewheel', selector, function(event) {
						var $el = $(this),
							scrollTop = this.scrollTop,
							scrollHeight = this.scrollHeight,
							height = $el.height(),
							originalEvent = event.originalEvent,
							delta = (event.type === 'DOMMouseScroll' ? originalEvent.detail * -40 : originalEvent.wheelDelta),
							up = delta > 0;

						function prevent() {
							event.stopPropagation();
							event.preventDefault();
							event.returnValue = false;
							return false
						}
						if (!up && -delta > scrollHeight - height - scrollTop) {
							$el.scrollTop(scrollHeight);
							return prevent()
						} else if (up && delta > scrollTop) {
							$el.scrollTop(0);
							return prevent()
						}
					})
				}
			});
			module.exports = Select3.Dropdown = Select3Dropdown
		}, {}],
		10: [function(_dereq_, module, exports) {
			'use strict';
			var $ = window.jQuery || window.Zepto;
			var Select3 = _dereq_(7);
			var MultipleSelect3 = _dereq_(13);

			function isValidEmail(email) {
				var atIndex = email.indexOf('@');
				var dotIndex = email.lastIndexOf('.');
				var spaceIndex = email.indexOf(' ');
				return (atIndex > 0 && dotIndex > atIndex + 1 && dotIndex < email.length - 2 && spaceIndex === -1)
			}
			function lastWord(token, length) {
				length = (length === undefined ? token.length : length);
				for (var i = length - 1; i >= 0; i--) {
					if ((/\s/).test(token[i])) {
						return token.slice(i + 1, length)
					}
				}
				return token.slice(0, length)
			}
			function stripEnclosure(token, enclosure) {
				if (token.slice(0, 1) === enclosure[0] && token.slice(-1) === enclosure[1]) {
					return token.slice(1, -1).trim()
				} else {
					return token.trim()
				}
			}
			function createEmailItem(token) {
				var email = lastWord(token);
				var name = token.slice(0, -email.length).trim();
				if (isValidEmail(email)) {
					email = stripEnclosure(stripEnclosure(email, '()'), '<>');
					name = stripEnclosure(name, '""').trim() || email;
					return {
						id: email,
						text: name
					}
				} else {
					return (token.trim() ? {
						id: token,
						text: token
					} : null)
				}
			}
			function emailTokenizer(input, selection, createToken) {
				function hasToken(input) {
					if (input) {
						for (var i = 0, length = input.length; i < length; i++) {
							var char = input[i];
							switch (char) {
							case ';':
							case ',':
							case '\n':
								return true;
							case ' ':
							case '\t':
								if (isValidEmail(lastWord(input, i))) {
									return true
								}
								break;
							case '"':
								do {
									i++
								} while (i < length && input[i] !== '"');
								break;
							default:
								continue
							}
						}
					}
					return false
				}
				function takeToken(input) {
					for (var i = 0, length = input.length; i < length; i++) {
						var char = input[i];
						switch (char) {
						case ';':
						case ',':
						case '\n':
							return {
								term: input.slice(0, i),
								input: input.slice(i + 1)
							};
						case ' ':
						case '\t':
							if (isValidEmail(lastWord(input, i))) {
								return {
									term: input.slice(0, i),
									input: input.slice(i + 1)
								}
							}
							break;
						case '"':
							do {
								i++
							} while (i < length && input[i] !== '"');
							break;
						default:
							continue
						}
					}
					return {}
				}
				while (hasToken(input)) {
					var token = takeToken(input);
					if (token.term) {
						var item = createEmailItem(token.term);
						if (item && !(item.id && Select3.findById(selection, item.id))) {
							createToken(item)
						}
					}
					input = token.input
				}
				return input
			}
			function EmailSelect3(options) {
				MultipleSelect3.call(this, options)
			}
			var callSuper = Select3.inherits(EmailSelect3, MultipleSelect3, {
				initSearchInput: function($input) {
					callSuper(this, 'initSearchInput', $input);
					$input.on('blur', function() {
						var term = $input.val();
						if (isValidEmail(lastWord(term))) {
							this.add(createEmailItem(term))
						}
					}.bind(this))
				},
				setOptions: function(options) {
					options = $.extend({
						createTokenItem: createEmailItem,
						showDropdown: false,
						tokenizer: emailTokenizer
					}, options);
					callSuper(this, 'setOptions', options)
				}
			});
			module.exports = Select3.InputTypes.Email = EmailSelect3
		}, {}],
		11: [function(_dereq_, module, exports) {
			'use strict';
			var Select3 = _dereq_(7);
			var KEY_DOWN_ARROW = 40;
			var KEY_ENTER = 13;
			var KEY_ESCAPE = 27;
			var KEY_UP_ARROW = 38;

			function listener(select3, $input) {
				function keyHeld(event) {
					var dropdown = select3.dropdown;
					if (dropdown) {
						if (event.keyCode === KEY_DOWN_ARROW) {
							dropdown.highlightNext()
						} else if (event.keyCode === KEY_UP_ARROW) {
							dropdown.highlightPrevious()
						}
					}
				}
				function keyReleased(event) {
					function open() {
						if (select3.options.showDropdown !== false) {
							select3.open()
						}
					}
					var dropdown = select3.dropdown;
					if (event.keyCode === KEY_ENTER && !event.ctrlKey) {
						if (dropdown) {
							dropdown.selectHighlight()
						} else if (select3.options.showDropdown !== false) {
							open()
						}
						event.preventDefault()
					} else if (event.keyCode === KEY_ESCAPE) {
						select3.close();
						event.preventDefault()
					} else if (event.keyCode === KEY_DOWN_ARROW || event.keyCode === KEY_UP_ARROW) {
						open();
						event.preventDefault()
					} else {
						open()
					}
				}
				$input.on('keydown', keyHeld).on('keyup', keyReleased)
			}
			Select3.SearchInputListeners.push(listener)
		}, {}],
		12: [function(_dereq_, module, exports) {
			'use strict';
			var escape = _dereq_(3);
			var Select3 = _dereq_(7);
			Select3.Locale = {
				ajaxError: function(term) {
					return 'Failed to fetch results for <b>' + escape(term) + '</b>'
				},
				loading: 'Loading...',
				loadMore: 'Load more...',
				needMoreCharacters: function(numCharacters) {
					return 'Enter ' + numCharacters + ' more characters to search'
				},
				noResults: 'No results found',
				noResultsForTerm: function(term) {
					return 'No results for <b>' + escape(term) + '</b>'
				}
			}
		}, {}],
		13: [function(_dereq_, module, exports) {
			'use strict';
			var $ = window.jQuery || window.Zepto;
			var Select3 = _dereq_(7);
			var KEY_BACKSPACE = 8;
			var KEY_DELETE = 46;
			var KEY_ENTER = 13;

			function MultipleSelect3(options) {
				Select3.call(this, options);
				this.$el.html(this.template('multipleSelectInput', {
					enabled: this.enabled
				}));
				this._highlightedItemId = null;
				this.initSearchInput(this.$('.select3-multiple-input:not(.select3-width-detector)'));
				this._rerenderSelection();
				if (!options.positionDropdown) {
					this.options.positionDropdown = function($el, $selectEl) {
						var offset = $selectEl.offset(),
							elHeight = $el.height(),
							selectHeight = $selectEl.height(),
							bottom = $selectEl[0].getBoundingClientRect().top + selectHeight + elHeight;
						$el.css({
							left: offset.left + 'px',
							top: offset.top + (typeof window !== 'undefined' && bottom > $(window).height() ? -elHeight : selectHeight) + 'px'
						}).width($selectEl.width())
					}
				}
			}
			var callSuper = Select3.inherits(MultipleSelect3, {
				add: function(item) {
					var itemIsId = Select3.isValidId(item);
					var id = (itemIsId ? item : this.validateItem(item) && item.id);
					if (this._value.indexOf(id) === -1) {
						this._value.push(id);
						if (itemIsId && this.options.initSelection) {
							this.options.initSelection([id], function(data) {
								if (this._value.indexOf(id) > -1) {
									item = this.validateItem(data[0]);
									this._data.push(item);
									this.triggerChange({
										added: item
									})
								}
							}.bind(this))
						} else {
							if (itemIsId) {
								item = this.getItemForId(id)
							}
							this._data.push(item);
							this.triggerChange({
								added: item
							})
						}
					}
					this.$searchInput.val('')
				},
				events: {
					'change': '_rerenderSelection',
					'change .select3-multiple-input': function() {
						return false
					},
					'click': '_clicked',
					'click .select3-multiple-selected-item': '_itemClicked',
					'keydown .select3-multiple-input': '_keyHeld',
					'keyup .select3-multiple-input': '_keyReleased',
					'paste .select3-multiple-input': '_onPaste',
					'select3-selected': '_resultSelected'
				},
				filterResults: function(results) {
					return results.filter(function(item) {
						return !Select3.findById(this._data, item.id)
					}, this)
				},
				getDataForValue: function(value) {
					return value.map(this.getItemForId.bind(this)).filter(function(item) {
						return !!item
					})
				},
				getValueForData: function(data) {
					return data.map(function(item) {
						return item.id
					})
				},
				remove: function(item) {
					var id = ($.type(item) === 'object' ? item.id : item);
					var removedItem;
					var index = Select3.findIndexById(this._data, id);
					if (index > -1) {
						removedItem = this._data[index];
						this._data.splice(index, 1)
					}
					if (this._value[index] !== id) {
						index = this._value.indexOf(id)
					}
					if (index > -1) {
						this._value.splice(index, 1)
					}
					if (removedItem) {
						this.triggerChange({
							removed: removedItem
						})
					}
					if (id === this._highlightedItemId) {
						this._highlightedItemId = null
					}
				},
				search: function() {
					var term = this.$searchInput.val();
					if (this.options.tokenizer) {
						term = this.options.tokenizer(term, this._data, this.add.bind(this), this.options);
						if ($.type(term) === 'string') {
							this.$searchInput.val(term)
						} else {
							term = ''
						}
					}
					if (this.dropdown) {
						callSuper(this, 'search')
					}
				},
				setOptions: function(options) {
					options = options || {};
					var backspaceHighlightsBeforeDelete = 'backspaceHighlightsBeforeDelete';
					if (options[backspaceHighlightsBeforeDelete] === undefined) {
						options[backspaceHighlightsBeforeDelete] = this.hasTouch
					}
					options.allowedTypes = options.allowedTypes || {};
					options.allowedTypes[backspaceHighlightsBeforeDelete] = 'boolean';
					callSuper(this, 'setOptions', options)
				},
				validateData: function(data) {
					if (data === null) {
						return []
					} else if ($.type(data) === 'array') {
						return data.map(this.validateItem.bind(this))
					} else {
						throw new Error('Data for MultiSelect3 instance should be array');
					}
				},
				validateValue: function(value) {
					if (value === null) {
						return []
					} else if ($.type(value) === 'array') {
						if (value.every(Select3.isValidId)) {
							return value
						} else {
							throw new Error('Value contains invalid IDs');
						}
					} else {
						throw new Error('Value for MultiSelect3 instance should be an array');
					}
				},
				_backspacePressed: function() {
					if (this.options.backspaceHighlightsBeforeDelete) {
						if (this._highlightedItemId) {
							this._deletePressed()
						} else if (this._value.length) {
							this._highlightItem(this._value.slice(-1)[0])
						}
					} else if (this._value.length) {
						this.remove(this._value.slice(-1)[0])
					}
				},
				_clicked: function() {
					if (this.enabled) {
						this.focus();
						this._open();
						return false
					}
				},
				_createToken: function() {
					var term = this.$searchInput.val();
					var createTokenItem = this.options.createTokenItem;
					if (term && createTokenItem) {
						var item = createTokenItem(term);
						if (item) {
							this.add(item)
						}
					}
				},
				_deletePressed: function() {
					if (this._highlightedItemId) {
						this.remove(this._highlightedItemId)
					}
				},
				_highlightItem: function(id) {
					this._highlightedItemId = id;
					this.$('.select3-multiple-selected-item').removeClass('highlighted').filter('[data-item-id=' + Select3.quoteCssAttr(id) + ']').addClass('highlighted');
					if (this.hasKeyboard) {
						this.focus()
					}
				},
				_itemClicked: function(event) {
					if (this.enabled) {
						this._highlightItem(this._getItemId(event))
					}
				},
				_itemRemoveClicked: function(event) {
					this.remove(this._getItemId(event));
					this._updateInputWidth();
					return false
				},
				_keyHeld: function() {
					this._originalValue = this.$searchInput.val()
				},
				_keyReleased: function(event) {
					var inputHadText = !! this._originalValue;
					if (event.keyCode === KEY_ENTER && !event.ctrlKey) {
						if (this.options.createTokenItem) {
							this._createToken()
						}
					} else if (event.keyCode === KEY_BACKSPACE && !inputHadText) {
						this._backspacePressed()
					} else if (event.keyCode === KEY_DELETE && !inputHadText) {
						this._deletePressed()
					}
					this._updateInputWidth()
				},
				_onPaste: function() {
					setTimeout(function() {
						this.search();
						if (this.options.createTokenItem) {
							this._createToken()
						}
					}.bind(this), 10)
				},
				_open: function() {
					if (this.options.showDropdown !== false) {
						this.open()
					}
				},
				_renderSelectedItem: function(item) {
					this.$searchInput.before(this.template('multipleSelectedItem', $.extend({
						highlighted: (item.id === this._highlightedItemId),
						removable: !this.options.readOnly
					}, item)));
					var quotedId = Select3.quoteCssAttr(item.id);
					this.$('.select3-multiple-selected-item[data-item-id=' + quotedId + ']').find('.select3-multiple-selected-item-remove').on('click', this._itemRemoveClicked.bind(this))
				},
				_rerenderSelection: function(event) {
					event = event || {};
					if (event.added) {
						this._renderSelectedItem(event.added);
						this._scrollToBottom()
					} else if (event.removed) {
						var quotedId = Select3.quoteCssAttr(event.removed.id);
						this.$('.select3-multiple-selected-item[data-item-id=' + quotedId + ']').remove()
					} else {
						this.$('.select3-multiple-selected-item').remove();
						this._data.forEach(this._renderSelectedItem, this);
						this._updateInputWidth()
					}
					if (event.added || event.removed) {
						if (this.dropdown) {
							this.dropdown.showResults(this.filterResults(this.results), {
								hasMore: this.dropdown.hasMore
							})
						}
						if (this.hasKeyboard) {
							this.focus()
						}
					}
					this.positionDropdown();
					this._updatePlaceholder()
				},
				_resultSelected: function(event) {
					if (this._value.indexOf(event.id) === -1) {
						this.add(event.item)
					} else {
						this.remove(event.item)
					}
				},
				_scrollToBottom: function() {
					var $inputContainer = this.$('.select3-multiple-input-container');
					$inputContainer.scrollTop($inputContainer.height())
				},
				_updateInputWidth: function() {
					if (this.enabled) {
						var $input = this.$searchInput,
							$widthDetector = this.$('.select3-width-detector');
						$widthDetector.text($input.val() || !this._data.length && this.options.placeholder || '');
						$input.width($widthDetector.width() + 20);
						this.positionDropdown()
					}
				},
				_updatePlaceholder: function() {
					var placeholder = this._data.length ? '' : this.options.placeholder;
					if (this.enabled) {
						this.$searchInput.attr('placeholder', placeholder)
					} else {
						this.$('.select3-placeholder').text(placeholder)
					}
				}
			});
			module.exports = Select3.InputTypes.Multiple = MultipleSelect3
		}, {}],
		14: [function(_dereq_, module, exports) {
			'use strict';
			var $ = window.jQuery || window.Zepto;
			var Select3 = _dereq_(7);

			function SingleSelect3(options) {
				Select3.call(this, options);
				this.$el.html(this.template('singleSelectInput', this.options));
				this._rerenderSelection();
				if (!options.positionDropdown) {
					this.options.positionDropdown = function($el, $selectEl) {
						var offset = $selectEl.offset(),
							top = offset.top + $selectEl.height();
						if (typeof window !== 'undefined') {
							var fixedOffset = $selectEl[0].getBoundingClientRect(),
								elHeight = $el.height(),
								windowHeight = $(window).height();
							if (fixedOffset.top + elHeight > windowHeight) {
								top = Math.max(windowHeight - elHeight + offset.top - fixedOffset.top, 0)
							}
						}
						$el.css({
							left: offset.left + 'px',
							top: top + 'px'
						}).width($selectEl.width())
					}
				}
			}
			var callSuper = Select3.inherits(SingleSelect3, {
				events: {
					'change': '_rerenderSelection',
					'click': '_clicked',
					'select3-selected': '_resultSelected'
				},
				getDataForValue: function(value) {
					return this.getItemForId(value)
				},
				getValueForData: function(data) {
					return (data ? data.id : null)
				},
				setOptions: function(options) {
					options = options || {};
					options.allowedTypes = $.extend(options.allowedTypes || {}, {
						allowClear: 'boolean',
						showSearchInputInDropdown: 'boolean'
					});
					callSuper(this, 'setOptions', options)
				},
				validateData: function(data) {
					return (data === null ? data : this.validateItem(data))
				},
				validateValue: function(value) {
					if (value === null || Select3.isValidId(value)) {
						return value
					} else {
						throw new Error('Value for SingleSelect3 instance should be a valid ID or null');
					}
				},
				_clicked: function() {
					if (this.enabled) {
						if (this.dropdown) {
							this.close()
						} else if (this.options.showDropdown !== false) {
							this.open({
								showSearchInput: this.options.showSearchInputInDropdown !== false
							})
						}
						return false
					}
				},
				_itemRemoveClicked: function() {
					this.data(null);
					return false
				},
				_rerenderSelection: function() {
					var $container = this.$('.select3-single-result-container');
					if (this._data) {
						$container.html(this.template('singleSelectedItem', $.extend({
							removable: this.options.allowClear && !this.options.readOnly
						}, this._data)));
						$container.find('.select3-single-selected-item-remove').on('click', this._itemRemoveClicked.bind(this))
					} else {
						$container.html(this.template('singleSelectPlaceholder', {
							placeholder: this.options.placeholder
						}))
					}
				},
				_resultSelected: function(event) {
					this.data(event.item);
					this.close()
				}
			});
			module.exports = Select3.InputTypes.Single = SingleSelect3
		}, {}],
		15: [function(_dereq_, module, exports) {
			'use strict';
			var Select3 = _dereq_(7);
			var Select3Dropdown = _dereq_(9);

			function Select3Submenu(options) {
				this.parentMenu = options.parentMenu;
				Select3Dropdown.call(this, options);
				this._closeSubmenuTimeout = 0
			}
			var callSuper = Select3.inherits(Select3Submenu, Select3Dropdown, {
				close: function() {
					if (this.options.restoreOptions) {
						this.select3.setOptions(this.options.restoreOptions)
					}
					if (this.options.restoreResults) {
						this.select3.results = this.options.restoreResults
					}
					if (this.submenu) {
						this.submenu.close()
					}
					callSuper(this, 'close');
					if (this.parentMenu) {
						this.parentMenu.submenu = null;
						this.parentMenu = null
					}
				},
				highlight: function(item) {
					if (this.submenu) {
						if (!this.highlightedResult || this.highlightedResult.id !== item.id) {
							if (this._closeSubmenuTimeout) {
								clearTimeout(this._closeSubmenuTimeout)
							}
							this._closeSubmenuTimeout = setTimeout(this._closeSubmenuAndHighlight.bind(this, item), 100);
							return
						}
					} else {
						if (this.parentMenu && this.parentMenu._closeSubmenuTimeout) {
							clearTimeout(this.parentMenu._closeSubmenuTimeout);
							this.parentMenu._closeSubmenuTimeout = 0
						}
					}
					this._doHighlight(item)
				},
				highlightNext: function() {
					if (this.submenu) {
						this.submenu.highlightNext()
					} else {
						callSuper(this, 'highlightNext')
					}
				},
				highlightPrevious: function() {
					if (this.submenu) {
						this.submenu.highlightPrevious()
					} else {
						callSuper(this, 'highlightPrevious')
					}
				},
				selectHighlight: function() {
					if (this.submenu) {
						this.submenu.selectHighlight()
					} else {
						callSuper(this, 'selectHighlight')
					}
				},
				selectItem: function(id) {
					var select3 = this.select3;
					var item = Select3.findNestedById(select3.results, id);
					if (item && !item.submenu) {
						var options = {
							id: id,
							item: item
						};
						if (select3.triggerEvent('select3-selecting', options)) {
							select3.triggerEvent('select3-selected', options)
						}
					}
				},
				showResults: function(results, options) {
					if (this.submenu) {
						this.submenu.showResults(results, options)
					} else {
						callSuper(this, 'showResults', results, options)
					}
				},
				triggerClose: function() {
					if (this.parentMenu) {
						this.select3.$el.trigger('select3-close-submenu')
					} else {
						callSuper(this, 'triggerClose')
					}
				},
				triggerOpen: function() {
					if (this.parentMenu) {
						this.select3.$el.trigger('select3-open-submenu')
					} else {
						callSuper(this, 'triggerOpen')
					}
				},
				_closeSubmenuAndHighlight: function(item) {
					if (this.submenu) {
						this.submenu.close()
					}
					this._doHighlight(item)
				},
				_doHighlight: function(item) {
					callSuper(this, 'highlight', item);
					if (item.submenu && !this.submenu) {
						var select3 = this.select3;
						var Dropdown = select3.options.dropdown || Select3.Dropdown;
						if (Dropdown) {
							var quotedId = Select3.quoteCssAttr(item.id);
							var $item = this.$('.select3-result-item[data-item-id=' + quotedId + ']');
							var $dropdownEl = this.$el;
							this.submenu = new Dropdown({
								parentMenu: this,
								position: item.submenu.positionDropdown ||
								function($el) {
									var offset = $item.offset();
									var width = $dropdownEl.width();
									$el.css({
										left: offset.left + width + 'px',
										top: offset.top + 'px'
									}).width(width)
								},
								restoreOptions: {
									items: select3.items,
									query: select3.options.query || null
								},
								restoreResults: select3.results,
								select3: select3,
								showSearchInput: item.submenu.showSearchInput
							});
							select3.setOptions({
								items: item.submenu.items || null,
								query: item.submenu.query || null
							});
							select3.search('')
						}
					}
				}
			});
			Select3.Dropdown = Select3Submenu;
			Select3.findNestedById = function(array, id) {
				for (var i = 0, length = array.length; i < length; i++) {
					var item = array[i],
						result;
					if (item.id === id) {
						result = item
					} else if (item.children) {
						result = Select3.findNestedById(item.children, id)
					} else if (item.submenu && item.submenu.items) {
						result = Select3.findNestedById(item.submenu.items, id)
					}
					if (result) {
						return result
					}
				}
				return null
			};
			module.exports = Select3Submenu
		}, {}],
		16: [function(_dereq_, module, exports) {
			'use strict';
			var escape = _dereq_(3);
			var Select3 = _dereq_(7);
			_dereq_(12);
			Select3.Templates = {
				dropdown: function(options) {
					var extraClass = (options.dropdownCssClass ? ' ' + options.dropdownCssClass : ''),
						searchInput = '';
					if (options.showSearchInput) {
						extraClass += ' has-search-input';
						var placeholder = options.searchInputPlaceholder;
						searchInput = ('<div class="select3-search-input-container">' + '<input class="select3-search-input"' + (placeholder ? ' placeholder="' + escape(placeholder) + '"' : '') + '>' + '</div>')
					}
					return ('<div class="select3-dropdown' + extraClass + '">' + searchInput + '<div class="select3-results-container"></div>' + '</div>')
				},
				error: function(options) {
					return ('<div class="select3-error">' + (options.escape ? escape(options.message) : options.message) + '</div>')
				},
				loading: function() {
					return '<div class="select3-loading">' + Select3.Locale.loading + '</div>'
				},
				loadMore: function() {
					return '<div class="select3-load-more">' + Select3.Locale.loadMore + '</div>'
				},
				multipleSelectInput: function(options) {
					return ('<div class="select3-multiple-input-container">' + (options.enabled ? '<input type="text" autocomplete="off" autocorrect="off" ' + 'autocapitalize="off" class="select3-multiple-input">' + '<span class="select3-multiple-input select3-width-detector">' + '</span>' : '<div class="select3-multiple-input select3-placeholder">' + '</div>') + '<div class="clearfix"></div>' + '</div>')
				},
				multipleSelectedItem: function(options) {
					var extraClass = (options.highlighted ? ' highlighted' : '');
					return ('<span class="select3-multiple-selected-item' + extraClass + '" ' + 'data-item-id="' + escape(options.id) + '">' + escape(options.text) + (options.removable ? '<a class="select3-multiple-selected-item-remove">' + '<i class="fa fa-remove"></i>' + '</a>' : '') + '</span>')
				},
				noResults: function(options) {
					var Locale = Select3.Locale;
					return ('<div class="select3-error">' + (options.term ? Locale.noResultsForTerm(options.term) : Locale.noResults) + '</div>')
				},
				resultChildren: function(options) {
					return '<div class="select3-result-children">' + options.childrenHtml + '</div>'
				},
				resultItem: function(options) {
					return ('<div class="select3-result-item" data-item-id="' + escape(options.id) + '">' + escape(options.text) + (options.submenu ? '<i class="select3-submenu-icon fa fa-chevron-right"></i>' : '') + '</div>')
				},
				resultLabel: function(options) {
					return '<div class="select3-result-label">' + escape(options.text) + '</div>'
				},
				singleSelectInput: ('<div class="select3-single-select">' + '<div class="select3-single-result-container"></div>' + '<i class="fa fa-sort-desc select3-caret"></i>' + '</div>'),
				singleSelectPlaceholder: function(options) {
					return ('<div class="select3-placeholder">' + escape(options.placeholder) + '</div>')
				},
				singleSelectedItem: function(options) {
					return ('<span class="select3-single-selected-item" ' + 'data-item-id="' + escape(options.id) + '">' + (options.removable ? '<a class="select3-single-selected-item-remove">' + '<i class="fa fa-remove"></i>' + '</a>' : '') + escape(options.text) + '</span>')
				}
			}
		}, {}],
		17: [function(_dereq_, module, exports) {
			'use strict';
			var $ = window.jQuery || window.Zepto;
			var Select3 = _dereq_(7);

			function defaultTokenizer(input, selection, createToken, options) {
				var createTokenItem = options.createTokenItem ||
				function(token) {
					return token ? {
						id: token,
						text: token
					} : null
				};
				var separators = options.tokenSeparators;

				function hasToken(input) {
					return input ? separators.some(function(separator) {
						return input.indexOf(separator) > -1
					}) : false
				}
				function takeToken(input) {
					for (var i = 0, length = input.length; i < length; i++) {
						if (separators.indexOf(input[i]) > -1) {
							return {
								term: input.slice(0, i),
								input: input.slice(i + 1)
							}
						}
					}
					return {}
				}
				while (hasToken(input)) {
					var token = takeToken(input);
					if (token.term) {
						var item = createTokenItem(token.term);
						if (item && !Select3.findById(selection, item.id)) {
							createToken(item)
						}
					}
					input = token.input
				}
				return input
			}
			Select3.OptionListeners.push(function(select3, options) {
				if (options.tokenSeparators) {
					options.allowedTypes = $.extend({
						tokenSeparators: 'array'
					}, options.allowedTypes);
					options.tokenizer = options.tokenizer || defaultTokenizer
				}
			})
		}, {}],
		18: [function(_dereq_, module, exports) {
			'use strict';
			var $ = window.jQuery || window.Zepto;
			var Select3 = _dereq_(7);

			function replaceSelectElement($el, options) {
				var value = (options.multiple ? [] : null);
				var mapOptions = function() {
						var $this = $(this);
						if ($this.is('option')) {
							var id = $this.attr('value') || $this.text();
							if ($this.prop('selected')) {
								if (options.multiple) {
									value.push(id)
								} else {
									value = id
								}
							}
							return {
								id: id,
								text: $this.attr('label') || $this.text()
							}
						} else {
							return {
								text: $this.attr('label'),
								children: $this.children('option,optgroup').map(mapOptions).get()
							}
						}
					};
				options.allowClear = ('allowClear' in options ? options.allowClear : !$el.prop('required'));
				options.items = $el.children('option,optgroup').map(mapOptions).get();
				options.placeholder = options.placeholder || $el.data('placeholder') || '';
				options.value = value;
				var $div = $('<div>').attr({
					'class': $el.attr('class'),
					'id': $el.attr('id'),
					'name': $el.attr('name'),
					'style': $el.attr('style')
				});
				$el.replaceWith($div);
				return $div
			}
			Select3.OptionListeners.push(function(select3, options) {
				var $el = select3.$el;
				if ($el.is('select')) {
					if ($el.attr('autofocus')) {
						setTimeout(function() {
							select3.focus()
						}, 1)
					}
					select3.$el = replaceSelectElement($el, options);
					select3.$el[0].select3 = select3
				}
			})
		}, {}]
	}, {}, [1])(1)
});